package com.ruoyi.blog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.blog.mapper.BlogLinkApplyMapper;
import com.ruoyi.blog.domain.BlogLinkApply;
import com.ruoyi.blog.service.IBlogLinkApplyService;

/**
 * 博客申请友链Service业务层处理
 * 
 * @author 谭潇
 * @date 2021-05-21
 */
@Service
public class BlogLinkApplyServiceImpl implements IBlogLinkApplyService 
{
    @Autowired
    private BlogLinkApplyMapper blogLinkApplyMapper;

    /**
     * 查询博客申请友链
     * 
     * @param id 博客申请友链ID
     * @return 博客申请友链
     */
    @Override
    public BlogLinkApply selectBlogLinkApplyById(Long id)
    {
        return blogLinkApplyMapper.selectBlogLinkApplyById(id);
    }

    /**
     * 查询博客申请友链列表
     * 
     * @param blogLinkApply 博客申请友链
     * @return 博客申请友链
     */
    @Override
    public List<BlogLinkApply> selectBlogLinkApplyList(BlogLinkApply blogLinkApply)
    {
        return blogLinkApplyMapper.selectBlogLinkApplyList(blogLinkApply);
    }

    /**
     * 新增博客申请友链
     * 
     * @param blogLinkApply 博客申请友链
     * @return 结果
     */
    @Override
    public int insertBlogLinkApply(BlogLinkApply blogLinkApply)
    {
        blogLinkApply.setCreateTime(DateUtils.getNowDate());
        return blogLinkApplyMapper.insertBlogLinkApply(blogLinkApply);
    }

    /**
     * 修改博客申请友链
     * 
     * @param blogLinkApply 博客申请友链
     * @return 结果
     */
    @Override
    public int updateBlogLinkApply(BlogLinkApply blogLinkApply)
    {
        return blogLinkApplyMapper.updateBlogLinkApply(blogLinkApply);
    }

    /**
     * 批量删除博客申请友链
     * 
     * @param ids 需要删除的博客申请友链ID
     * @return 结果
     */
    @Override
    public int deleteBlogLinkApplyByIds(Long[] ids)
    {
        return blogLinkApplyMapper.deleteBlogLinkApplyByIds(ids);
    }

    /**
     * 删除博客申请友链信息
     * 
     * @param id 博客申请友链ID
     * @return 结果
     */
    @Override
    public int deleteBlogLinkApplyById(Long id)
    {
        return blogLinkApplyMapper.deleteBlogLinkApplyById(id);
    }
}
